import { createRouter, createWebHistory } from 'vue-router';
import Home from '../views/Home.vue';

import Tools from '../views/Tools.vue';
import ToolDetail from '@/views/ToolDetail.vue';
import ToolList from '@/components/ToolList.vue'; // 创建 ToolList 组件用于显示工具卡片

import Docs from '../views/Docs.vue';
import DocDetail from '@/views/DocDetail.vue';
import QuickOn from '@/doc/QuickOn.vue'; 

const routes = [
  { path: '/', name: 'Home', component: Home },
  {
    path: '/tools',
    component: Tools,
    children: [
      {
        path: '',
        component: ToolList, // 工具列表页面
      },
      {
        path: ':name',
        component: ToolDetail, // 工具详情页面
      },
    ],
  },
  {
    path: '/doc',
    component: Docs,
    children: [
      {
        path: '',
        component: QuickOn, // 引导页面
      },
      {
        path: ':name',
        component: DocDetail, // 工具详情页面
      },
    ],
  },
];

const router = createRouter({
  history: createWebHistory(),
  routes,
});

export default router;
